import { MidwayConfig } from '@midwayjs/core';
import { UserEntity } from '../entity/user.entity';
import { MessageEntity } from '../entity/message.entity';

export default {
  keys: '1671248908243_8313',
  koa: {
    port: 7001,
  },
  passport: {
    session: false,
  },
  jwt: {
    secret: '2f230b1871714e859f9c8502f5103961',
    expiresIn: '2d',
  },
  cors: {
    origin: '*',
  },
  typeorm: {
    dataSource: {
      default: {
        type: 'mysql',
        host: 'localhost',
        port: 3306,
        username: 'root',
        password: '293040',
        database: 'xtarget',
        synchronize: true,
        logging: false,
        entities: [UserEntity, MessageEntity],
      },
    },
  },
  upload: {
    mode: 'file',
    whitelist: null, // 配置NULL则不校验
    fileSize: '100000000gb',
    base64: false,
  },
  bodyParser: {
    enableTypes: ['json', 'form', 'text', 'xml'],
    formLimit: '10mb',
    jsonLimit: '10mb',
    textLimit: '10mb',
    xmlLimit: '10mb',
  },
} as MidwayConfig;
